home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 25 / Mac Magazin and MacEasy Magazine CD - Issue 25.iso / Grafik & Text / BibTeX / Source code / bibtex.h < prev    next >
C/C++ Source or Header  |  1996-05-17  |  4KB  |  141 lines

  1. #pragma once
  2.  
  3. /*
  4.  * Main include file for BibTeX in C.
  5.  *
  6.  * Tim Morgan  2/15/88
  7.  * Eduardo Krell 4/21/88
  8.  */
  9. #if (__STDC__ || defined(__cplusplus))
  10. #define STDC            1
  11. #else
  12. #define STDC            0
  13. #endif
  14.  
  15. #include "CBibtexApp.h"
  16. #include "bibutils.h"
  17.  
  18. typedef FileDesc BIBFILE;
  19. #include <setjmp.h>
  20.  
  21. /*
  22.  * The type "schar" should be defined here to be the smallest signed
  23.  * type available.  ANSI C compilers may need to use "signed char".
  24.  * If you don't have signed characters, then use "short".
  25.  */
  26. typedef    char schar;
  27.  
  28. /*
  29.  * The type "integer" must be a signed integer capable of holding at
  30.  * least the range of numbers (-2^31)..(2^32-1).
  31.  * The ANSI draft C standard says that "long" meets this requirement.
  32.  */
  33. typedef long integer;
  34.  
  35. /* Boolean can by any convenient type */
  36. typedef char boolean;
  37.  
  38. /*
  39.  * The type glueratio should be a floating-point type which won't
  40.  * unnecessarily increase the size of the memoryword structure.
  41.  * If you're building a normal-sized TeX, then it must meet
  42.  * the following restriction: sizeof(glueratio) <= sizeof(integer).
  43.  * But if you build a BIG TeX, you can and should change this to
  44.  * double to avoid loss of precision and conversions to and from
  45.  * double during calculations.
  46.  */
  47. typedef float glueratio;
  48.  
  49. /* Real can by any convenient floating-point type */
  50. typedef double real;
  51.  
  52. /* TeX search paths: This is what we use on macs. */
  53. #define    TEXINPUTS    "."
  54.  
  55. /* Fix so we don't actually call exit() for ok conditions */
  56. #define exit LocalExit
  57.  
  58. /*
  59.  * The maximum length of a filename including a directory specifier.
  60.  * This value is also defined in the change files for tex and mf, so
  61.  * it appears in texd.h and mfd.h as "filenamesize".  It can be safely
  62.  * changed in these files if necessary, although you should really edit
  63.  * the files tex/ctex.ch and mf/cmf.ch.  Most sites should not have to
  64.  * change this value anyway, since it doesn't hurt much if it's too large.
  65.  * If you change it here, then change it in both the changefiles to match!
  66.  */
  67. #define    FILENAMESIZE    1024
  68.  
  69.  
  70. #undef    STAT
  71. #undef    DEBUG
  72.  
  73. extern char *strncpy();
  74.  
  75. typedef BIBFILE *file_ptr;
  76. typedef BIBFILE *palphafile;
  77. #define    incr(x)    ++(x)
  78. #define    decr(x)    --(x)
  79. extern int testaccess();
  80. #define    true    1
  81. #define    false    0
  82. #define rewrite(f,n)    f = openf(n, "w")
  83. #define    reset(f,n)    f = openf(n, "r")
  84. #define    aclose(f)    if (f) (void) fclose(f)
  85. #define    chr(x)        (x)
  86. extern void lineread(), setpaths();
  87. #define readln(f)    {register c; while ((c=getc(f))!='\n' && c!=EOF); }
  88. extern BIBFILE *openf();
  89. #define    uexit(x)    exit((int) (x))
  90. #define    Fputs(stream, s)    (void) fputs(s, stream)
  91.  
  92. /* Changed by Vince */
  93. //#define printstr(s,c)    fprintf(logfile,"%s%c",s,c);fprintf(stdout,"%s%c",s,c)
  94. #define printstr(s,c)    { \
  95.     (void)FPrintFStdErr( s,c); \
  96.     (void)FPrintF(logfile,s,c);\
  97. }
  98.  
  99. //#define    eof(f)        feof(f)
  100. #define    eof(f)        FEof(f)
  101.  
  102. /* Added by Vince */
  103. extern void LocalExit(int);
  104. void CloseAllFilesAfterError(void);
  105.  
  106. typedef schar ASCIIcode  ; 
  107. typedef schar lextype  ; 
  108. typedef schar idtype  ; 
  109. /* We're using Mac i/o so we change this */
  110. //typedef file_ptr alphafile  ; 
  111. typedef FileDescPtr alphafile;
  112.  
  113. typedef integer bufpointer  ; 
  114. typedef ASCIIcode *buftype; 
  115. typedef integer poolpointer  ; 
  116. typedef integer strnumber  ; 
  117. typedef short hashloc  ; 
  118. typedef short hashpointer  ; 
  119. typedef schar strilk  ; 
  120. typedef schar pdsloc  ; 
  121. typedef schar pdslen  ; 
  122. typedef char pdstype [13] ; 
  123. typedef integer auxnumber  ; 
  124. typedef integer bibnumber  ; 
  125. typedef integer citenumber  ; 
  126. typedef schar fnclass  ; 
  127. typedef integer wizfnloc  ; 
  128. typedef integer intentloc  ; 
  129. typedef integer strentloc  ; 
  130. typedef schar strglobloc  ; 
  131. typedef integer fieldloc  ; 
  132. typedef short hashptr2  ; 
  133. typedef integer litstkloc  ; 
  134. typedef schar stktype  ; 
  135. typedef integer bltinrange  ; 
  136. /*
  137.  *  Externals for directory search stuff ... jdl 
  138.  */
  139. extern FSSpec        Folders[3];
  140. extern FInfo     AuxFileInfo;
  141. /*  done ... jdl */